<@override name="title">${art.name}</@override>
<@override name="content">
<#assign bases=springMacroRequestContext.getContextUrl("")>
<html lang="en">
<head>
    <style>
        .input{
        border-style:ridge;
        border-color:#C9CCD0;
        border-style:solid;
        }

    </style>
    <meta charset="UTF-8">
    <title>${art.name}</title>
</head>
<body>
<dialog open id='demo' style='display:none;' draggable="true">
    <div style="float:left;font-size:6px;font-weight:bold;">这是一个弹窗</div>
    <div style="float:right;border:0px;font-size:6px">
        <button id='close' style="height:15px;width:20px;color:#ffffff;border:2px;border-color:#f3f3f3;font-size:5px;border-radius:3px;" onclick="getElementById('demo').setAttribute('style','display:none')">×</button>
    </div>
    <div style="clear:both">
        <p>确定要删除吗？这将无法恢复。</p>
    </div>
    <div style="float:right;">
        <form id="delete" action="${base}/delete" method="post">后台密码:<input type="password" name="password"><input type="hidden" value="${art.id}" name="id"></form>
        <button style="color:#ffffff;background:#aa1111;border:0px;font-size:5px;border-radius:3px;display:inline-block;" onclick="document.getElementById('delete').submit();getElementById('demo').setAttribute('style','display:none')">确定</button>
        <button style="color:#ffffff;background:#bebcc3;border:0px;font-size:5px;border-radius:3px;display:inline-block;" onclick="getElementById('demo').setAttribute('style','display:none')">取消</button>
    </div>

</dialog>

<script>
function show(id){
document.getElementById(id).setAttribute('style','display:block;padding:2px;border: medium double #bebcc3;border-radius:5px;')
}
</script>
<div style="text-align: center;margin-left:25%;width:50%" align="center">
<h3>${art.name}</h3>
    <p style="font-size:10px">阅读量:${art.play}</p>
    <pre>点赞:${art.likes!0} ${date!}</pre>
    <button type="button" onclick="show('demo')">删除</button>
    <button type="button" onclick="window.location.replace('${base}/edit?id=${art.id!}')">编辑</button>
    <pre><p style="font-size:17px;white-space:pre-line;font-family: -apple-system-font, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif;" align="left">${art.content}</p></pre>

    <button  type="button" onclick="userclick()" style="background-image:url(../../../res/i/like.png);height:50px;width:50px"></button>
    <hr noshade style="background-color:#CCCCCC;border:none;height:1px">
<form id="form" action="${base}/like" method="post"><input type="hidden" value=${art.id} name="id" id="id"></form>
</div>
<h3 style="margin-left:19%">评论区</h3>

<form action="${base}/newcomments" id="newcomments" method="post"><div style="float:left;margin-left:19%"><input type="text" placeholder="你的昵称" class="input" style="margin-bottom:1px;background-color:#F1F2F3;" name="user"><br><input type="text" class="input" placeholder="写一个新评论吧！" style="background-color:#F1F2F3;" name="content" maxlength="250"></div><input type="hidden" name="id" value=${art.id}><input type="submit" placeholder="发送评论" style="color:black;height:55px;background-color:#4169E1;border-style:none;margin-left:10px"></form>
<#list comment as item><div style="margin-left:10%"><span style="margin-left:10%">${item.user!}</span><br><span style="margin-bottom:0px;margin-left:10%;font-size:5px">${item.date!}</span><a id="b${item.id}" href="javascript:void()" onclick="document.getElementById('ip${item.id}').setAttribute('style','display:block;margin-left:10%;font-size:2px');document.getElementById('b${item.id}').setAttribute('style','display:none;margin-left:10%')" style="font-size:5px;margin-left:10%">显示IP信息</a><p id="ip${item.id!}" style="font-size:2px;display:none;margin-left:30%">${item.ip!}</p><xmp style="margin-left:10%;font-family:STHeiti2;margin-top:0px;font-size:20px">${item.content!}</xmp></div><hr noshade style="background-color:#CCCCCC;border:none;height:1px"></#list>
</body>
</html>
</@override>
<@extends name="_base.html" />
<script>function userclick(){
document.getElementById("form").submit();
setTimeout("location.reload();",1000);
 }</script>